interface IdatetimepickerScope extends ng.IScope {
  
}

class datetimepicker implements ng.IDirective {
  constructor() { }
  static instance() : ng.IDirective { return new datetimepicker; }

  restrict: string = 'A';
  link($scope : IdatetimepickerScope, element : ng.IAugmentedJQuery, attr : any) {
      var _conf:any = { lang: 'zh'};//format:	'Y.m.d H:i'
			if (attr.plugintype == 'datetime') {
				_conf.format = attr.format || 'Y.m.d H:i';
				$(element).datetimepicker(_conf);
			} else if (attr.plugintype == 'date') {
				_conf.format = attr.format || 'Y.m.d';
				_conf.timepicker = false;
				$(element).datetimepicker(_conf);
			} else if (attr.plugintype == 'time') {
				_conf.format = attr.format || 'H:i:s';
				_conf.datepicker = false;
				$(element).datetimepicker(_conf);
			}
			// $(element).append("	<span id='openDate' class='input-group-addon curpoint'> <span class='glyphicon glyphicon-calendar'></span> </span>")
			// $("#openDate").click(()=>{
			// 		$(element).datetimepicker('show')
			// });
  } 
}

angular.module('tms').directive('datetimepicker', datetimepicker.instance);